package com.wfg

import scala.language.postfixOps

object Hello {
  def main(args: Array[String]): Unit = {
    print("hello")


    var str:String = "Hello";
    val valstr:String = "word";

    println(str)
    println(valstr)
    //for（变量<-表达式/数组/集合）
    for (i <- 0 to 10) {
      println(i)
    }
    println("================================================")
    //在0-9之间，能被2整除且大于5的数才输出
    for (i <- 0 to 10;if i%2 == 0 ; if i > 5) {
      println(i)
    }
    println("=================while===============================")
    var i = 0;
    while (i < 10) {
      println(i)
      i +=2
    }
    println("===============do==while===============================")
    i = 1;
    do {
      println(i)
      i += 3
    } while (i < 10)
  }
}
